<?php
class Application_Form_Vehicle extends Application_Form_Product
{
	public function __construct($options = null)
	{
		parent::__construct($options);
		$this->setName('vehicle');


		
		$mileage = new Zend_Form_Element_Text('mileage');
		$mileage->setLabel('Mileage:')
		->setAttrib('placeholder', 'in Km')
		->setRequired(true)
		->setFilters(array('StringTrim','StripTags'))
		->setValidators(array('NotEmpty'))
		->addValidator(new Zend_Validate_Digits());
		
		$yearCond = array('min' => 1900, 'max' => date('Y'));
		//Year Field
		$year = new Zend_Form_Element_Select('year');
		$year->setLabel('Year:');
		$cyear = array_combine(range(date('Y'),1900,-1), range(date('Y'),1900,-1));
		$year->addMultiOptions(array('-1' => 'Year:')+$cyear);
		$year->class = 'year';
		$year->addValidator(new Zend_Validate_Between($yearCond))
		->addErrorMessage('You need to select one value');
		
		
		
		$elements = array($mileage, $year);
		$this->addElements($elements);



	}
}